import { DictVO, DictDTO, Dict } from './model/dictModel';
import { defHttp } from '/@/utils/http/axios';

enum Api {
  List = '/sys/dict/list',
  DictList = '/sys/dict/dictList',
  Save = '/sys/dict/save',
  Del = '/sys/dict',
}

// 分页查询
export const list = (params: DictVO) => defHttp.post<DictDTO>({ url: Api.List, params });

// 查询
export const dictList = (params: DictVO) => defHttp.post<DictDTO>({ url: Api.DictList, params });

// 保存
export const save = (params: Dict) => defHttp.post<Dict>({ url: Api.Save, params });

// 删除
export const del = (params: { ids: String }) =>
  defHttp.delete<boolean>({ url: Api.Del + `/${params.ids}` });
